package br.com.cicero.notasfiscais.mb;

import java.util.Locale;

import javax.enterprise.context.RequestScoped;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;

@Named
@RequestScoped
public class InternacionalizacaoBean {
	
	private @Inject FacesContext context;
	
	public void mudaPara(String lingua) {
		Locale locale = new Locale(lingua);
		context.getViewRoot().setLocale(locale);
		context.getApplication().setDefaultLocale(locale);
	}

}
